<?
	  layout("/inc/win_layout.html",{title:sysTitle}){
    ?>
<div class="col-lg-4">
	<div class="panel" style="height:100%; width:100%; overflow: auto;">
		<div class="panel-heading">范畴树形菜单</div>
		<!--<div class="panel-heading" >
			 <span class="subtitle">
				<button type="button" onclick="addUpdateThesauriWordCategory('0')" class="btn btn-primary btn-green"  style="width:80px;"
					id="savejiedian">新&nbsp;&nbsp;建</button>&nbsp;&nbsp;
				<button type="button"  class="btn btn-primary btn-green"  style="width:80px;"
					id="editjiedian">编&nbsp;&nbsp;辑</button>&nbsp;&nbsp;
				<button type="button" class="btn btn-primary btn-green"  style="width:80px;"
					id="deletejiedian">删&nbsp;&nbsp;除</button>
			</span> 
		</div>-->
		<div class="panel-body">
			<ul id="tree" class="ztree" style="width:100%;height:405px;overflow: auto;"></ul>
		</div>
	</div>
</div>


<?} ?>

<script type="text/javascript">
	var classesId = window.parent.getZtreeClasses();
	var parentname=1;
	//树状结构
	$(function() {
		initTree();
	});

	var classid;
	var classname;
	var fcid;
	function getclassname(){
		return classname;
	}
	function getclassid() {
		return classid;
	}
	function initTree(){
		$.ajax({
			type : "post",
			data : {
				"classesId":classesId
			},
			url : "./findallThesauriWordCategoryZTree.do",
			dataType : "json",
			beforeSend : function(XMLHttpRequest) {
			},
			success : drawTree,
		});
	}

	function drawTree(data) {
		var setting = {
			view : {
				dblClickExpand : false,
			},
			data : {
				simpleData : {
					enable : true,
				}
			},
			check : {
				enable : false
			},
			callback : {
				onClick : onClick
			},
		};
		var zNodes = eval(data);
		$.fn.zTree.init($("#tree"), setting, zNodes).expandAll(true);
		zTree = $.fn.zTree.getZTreeObj("tree");
		zTree.expandNode(zTree.getNodes()[0], true);//指定某节点折叠

	}
	function onClick(e, treeId, treeNode) {
		classid = treeNode.id;
		classname=treeNode.name;
		fcid=treeNode.fcId;
		 if(treeNode.children==null)
        {
       			parentname=0;
        }else{
         		parentname=1;
        }
	}
	
	//根据范畴查询
	function Page() {
		 var index = parent.layer.getFrameIndex(window.name); 
         window.parent.findAllthesauriWordReferenceLieBiao(1,fcid,classname);
         parent.layer.close(index); 

	};
		
</script>